import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';

//应用程序入口文件

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule); //工厂函数创建nest实例(采用Express的API)
  app.useStaticAssets('public',{prefix: '/static'});  //支持静态资源的请求
  
  //全局路由前缀
  app.setGlobalPrefix('api');

  await app.listen(3000);
}
bootstrap();